import { defineComponent, type Slot } from 'vue'

export const useCreateReusableTemplate = () => {
  let render: any

  const DefineTemplate = defineComponent({
    setup(_, { slots }) {
      return () => {
        render = slots.default
      }
    }
  })

  const UseTemplate = (props: any) => render(props)

  return [DefineTemplate, UseTemplate]
}